﻿using System.Collections.Generic;

namespace Compiler.Primitives
{
    class Function
    {
        private readonly string _name;
        private readonly List<Argument> _args;
        private readonly string _code;

        public Function(string name, List<Argument> args, string code)
        {
            _name = name;
            _args = args;
            _code = code;
        }

        public string GetName()
        {
            return _name;
        }

        public string[] GetCode()
        {
            return _code.Trim().Length == 0 ? new string[0] : _code.Split('\n');
        }

        public List<Argument> GetArgs()
        {
            return _args;
        } 
    }
}
